<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta content="no-siteapp"/>

    <link rel="shortcut icon" type="image/x-icon" th:href="@{/favicon.ico}"/>
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script type="text/javascript" th:src="@{/lib/jquery/jquery.min.js}"></script>
    <script charset="utf-8" th:src="@{/lib/layui/layui.js}"></script>
    <script type="text/javascript"  th:src="@{/js/xadmin.js}"></script>
    <style>
        .layui-this > a > cite {
            color: #01AAED;
        }
    </style>
</head>
<body>
<!-- 顶部开始 -->
<div class="container">
    <div class="logo"><a th:href="@{/main}">Shiro Action</a></div>
    <div class="left_open">
        <i title="展开左侧栏" class="iconfont">&#xe699;</i>
    </div>
    <ul class="layui-nav right" lay-filter="">
        <li class="layui-nav-item">
            <a href="javascript:;">
                <shiro:principal property="username"/>
            </a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
                <dd><a>修改密码</a></dd>
                <dd><a href="login.html" th:href="@{logout}">退出</a></dd>
            </dl>
        </li>
    </ul>
</div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div class="left-nav">
    <div id="side-nav">
        <ul id="nav">
            <th:block th:include="common/public::menu(${menus})"/>
        </ul>
    </div>
</div>
<!-- 左侧菜单结束 -->
<!-- 右侧主体开始 -->
<div class="page-content">
    <div class="layui-tab tab" lay-filter="tab" lay-allowclose="false">
        <ul class="layui-tab-title">
            <li lay-id="/home" class="home layui-this">
                我的桌面
            </li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe tab-id="/home" src='./welcome.html' th:src="@{/welcome}" frameborder="0" scrolling="yes"
                        class="x-iframe"></iframe>
            </div>
        </div>
    </div>
</div>
<div class="page-content-bg"></div>
<!-- 右侧主体结束 -->
<!-- 中部结束 -->
<!-- 底部开始 -->
<!--<div class="footer">-->
    <!--<div class="copyright">Copyright ©2018 Shiro-Action All Rights Reserved</div>-->
<!--</div>-->
<!-- 底部结束 -->

<script type="application/javascript">

    layui.use(['form', 'element'], function () {

        $(function () {
            // 获取 URL 的路由值
            var layid = location.hash.replace(/^#tab=/, '');

            // 当路由值不为空则获取
            if (layid != null && layid !== '') {
                $("a[_href='" + layid + "']").click();
            }

            // 当切换标签卡时更改路由值
            element.on('tab(tab)', function (elem) {
                location.hash = 'tab=' + $(this).attr('lay-id');
            });
        });
    });

</script>
</body>
</html>